package org.jeecg.report.enums;


import lombok.Getter;


@Getter
public enum SpcA2Enum {
    A2_2(1.880, 2),
    A2_3(1.023, 3),
    A2_4(0.729, 4),
    A2_5(0.577, 5),
    A2_6(0.483, 6),
    A2_7(0.419, 7),
    A2_8(0.373, 8),
    A2_9(0.337, 9),
    A2_10(0.308, 10),
    A2_11(0.285, 11),
    A2_12(0.266, 12),
    A2_13(0.249, 13),
    A2_14(0.235, 14),
    A2_15(0.223, 15),
    A2_16(0.212, 16),
    A2_17(0.203, 17),
    A2_18(0.194, 18),
    A2_19(0.187, 19),
    A2_20(0.180, 20);
    // 成员变量
    private final Double constant;
    private final int num;

    // 构造方法
    SpcA2Enum(Double constant, int num) {
        this.constant = constant;
        this.num = num;
    }

    // 普通方法
    public static Double getConstant(int num) {
        for (SpcA2Enum c : SpcA2Enum.values()) {
            if (c.getNum() == num) {
                return c.constant;
            }
        }
        return null;
    }
}
